package com.example.demo.controller;

import com.example.demo.entity.Shopapplication;
import com.example.demo.service.ShopapplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * 王军凯21434010323 3.08
 */
@RestController
public class ShopapplicationController {
    @Autowired
    ShopapplicationService shopapplicationService;

    @GetMapping("/getall")
    public List<Shopapplication> getAllShop(){
        System.out.println("查询船舶信息");
        return shopapplicationService.getShopAll();
    }

    @GetMapping("/addshop")
    public int addShop(Shopapplication shop){
        System.out.println("进入添加方法");
        int temp=shopapplicationService.insterShop(shop);
        return temp;
    }

    @GetMapping("/updateshop")
    public int updateShop(Shopapplication shop){
        System.out.println("进入跟新方法");
        int temp=shopapplicationService.updateShop(shop);
        return temp;
    }

    @GetMapping("delshop")
    public int delShop(int id){
        System.out.println("进入删除方法");
        int temp=shopapplicationService.deleteShop(id);
        return temp;
    }

}

